home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / cp.z / cp
Encoding:
Text File  |  2002-10-03  |  12.0 KB  |  265 lines

  1.  
  2.  
  3.  
  4. CCCCPPPP((((1111))))                                                                    CCCCPPPP((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      cp, ln, mv - copy, link or move files
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ccccpppp [ ----aaaaDDDDffffiiiirrrrRRRRpppp ----bbbb ssssiiiizzzzeeee ----ttttPPPP ----eeee size ] file1 [file2 ...] target
  13.      llllnnnn [ ----ssssiiiiffff ] file1 [file2 ...] target
  14.      mmmmvvvv [ ----iiiiffff ] file1 [file2 ...] target
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _f_i_l_e_1 is copied (linked, moved) to _t_a_r_g_e_t.  Under no circumstance can
  18.      _f_i_l_e_1 and _t_a_r_g_e_t be the same (take care when using _s_h(1) metacharacters).
  19.      If _t_a_r_g_e_t is a directory, then one or more files are copied (linked,
  20.      moved) to that directory.  If _t_a_r_g_e_t is an existing file, its contents
  21.      are destroyed, except in the llllnnnn and llllnnnn ----ssss case where the command will
  22.      fail and llllnnnn will write a diagnostic message to standard error (use the ----iiii
  23.      or ----ffff option to override this behavior).  _N_O_T_E that this is a change from
  24.      the historical llllnnnn execution.
  25.  
  26.      If _m_v or _l_n determines that the mode of _t_a_r_g_e_t forbids writing, it will
  27.      print the mode (see _c_h_m_o_d(2)), ask for a response, and read the standard
  28.      input for one line; if the line begins with yyyy, the _m_v or _l_n occurs, if
  29.      permissible; if not, the command exits.  When the ----ffff option is used or if
  30.      the standard input is not a terminal, no questions are asked and the _m_v
  31.      or _l_n is done.  Additionally, if _t_a_r_g_e_t exists, then the ----ffff option will
  32.      force the link when llllnnnn ----ssss is specified.  If _c_p determines that the mode
  33.      of _t_a_r_g_e_t forbids writing, the command will fail and _c_p will write a
  34.      diagnostic message to standard error (use the ----iiii or ----ffff option to override
  35.      this behavior).
  36.  
  37.      If the _----_ffff option is specified with _m_v, any previous occurrences of the _----_iiii
  38.      option will be ignored.
  39.  
  40.      For _m_v, if _f_i_l_e_1 is a directory, _m_v will perform actions equivalent to
  41.      the rrrreeeennnnaaaammmmeeee function.  If this fails for any reasons other than those
  42.      described for the errno [[[[EEEEXXXXDDDDEEEEVVVV]]]],,,, _m_v will write a diagnostic message to
  43.      standard error, do nothing more with the current source file, and go on
  44.      to any remaining source files. Otherwise, the file hierarchy rooted in
  45.      _f_i_l_e_1 will be duplicated as a file hierarchy rooted in the destination
  46.      path. The time of last data modification, the time of last access, the
  47.      user ID and group ID and file mode will be duplicated.  If the user ID,
  48.      group ID or file mode of a regular file cannot be duplicated, the file
  49.      mode bits SSSS____IIIISSSSUUUUIIIIDDDD and SSSS____IIIISSSSGGGGIIIIDDDD will not be duplicated.  When files are
  50.      duplicated to another file system, the invoking process must has read
  51.      access to each file being duplicated.  If the duplication of the file
  52.      hierarchy fails for any reason, _m_v will write a diagnostic message to
  53.      standard error, do nothing more with the current source_file, and go on
  54.      to any remaining source_files. If the duplication of the file
  55.      characteristics fails for any reason, mv will write a diagnostic message
  56.      to standard error, but this failure will not cause _m_v to modify its exit
  57.      status.  If the copying or removal of _f_i_l_e_1 is prematurely terminated by
  58.      a signal or error, _m_v may leave a partial copy of _f_i_l_e_1 at the source or
  59.      destination. The _m_v utility will not modify both _f_i_l_e_1 and the
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCPPPP((((1111))))                                                                    CCCCPPPP((((1111))))
  71.  
  72.  
  73.  
  74.      destination path simultaneously; termination at any point will leave
  75.      either _f_i_l_e_1 or the destination path complete.
  76.  
  77.      For _m_v, if _f_i_l_e_1 is a file and _t_a_r_g_e_t is a link to another file with
  78.      links, the other links remain and _t_a_r_g_e_t becomes a new file.
  79.  
  80.      When _c_p is invoked, if _t_a_r_g_e_t is not an existing file, a new file is
  81.      created with the same mode as _f_i_l_e_1 except that the mode is modified by
  82.      the user's umask, and the sticky bit is not set unless you are super-
  83.      user; the owner and group of _t_a_r_g_e_t are those of the user.  If _t_a_r_g_e_t is
  84.      a file, copying a file into _t_a_r_g_e_t does not change its mode, owner or
  85.      group.  The last modification time of _t_a_r_g_e_t (and last access time, if
  86.      _t_a_r_g_e_t did not exist) and the last access time of _f_i_l_e_1 are set to the
  87.      time the copy was made.  If _t_a_r_g_e_t is a link to a file, all links remain
  88.      and the file is changed.
  89.  
  90.      When copying between XFS filesystems, _c_p will replicate holes in _f_i_l_e_1 in
  91.      _t_a_r_g_e_t.
  92.  
  93.      If the _----_pppp option is specified, _c_p will duplicate the following
  94.      characteristics of each source file in the corresponding destination
  95.      file:
  96.  
  97.      1111....   The time of last data modification and time of last access. If this
  98.           duplication fails for any reason, _c_p will write a diagnostic message
  99.           to standard error.
  100.  
  101.      2222....   The user ID and group ID. If this duplication fails for any reason,
  102.           _c_p will write a diagnostic message to standard error.
  103.  
  104.      3333....   The file permission bits and the S_ISUID and S_ISGID bits. Other,
  105.           implementation-dependent, bits may be duplicated as well. If this
  106.           duplication fails for any reason, _c_p will write a diagnostic message
  107.           to standard error.
  108.  
  109.           If the user ID or the group ID cannot be duplicated,
  110.           the file permission bits S_ISUID and S_ISGID will be cleared. If
  111.           these bits are present in the source file but are not duplicated in
  112.           the destination file, _c_p will write a diagnostic message to standard
  113.           error.
  114.  
  115.      4444....   The project ID, if the invoking user has CAP_SETUID capability.
  116.           Otherwise the project will be set to the invoking user's active
  117.           project ID.
  118.  
  119.      The ----aaaa option to _c_p will copy user mode XFS attributes, the option is
  120.      silently ignored if any of the files involved is not on an XFS
  121.      filesystem.
  122.  
  123.      The ----DDDD option to _c_p specifies that direct IO should be used to copy the
  124.      file, file data is not buffered in the kernel.  The ----bbbb bbbblllloooocccckkkkssssiiiizzzzeeee option
  125.      can be used to specify a specific blocksize to use, this option can also
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCPPPP((((1111))))                                                                    CCCCPPPP((((1111))))
  137.  
  138.  
  139.  
  140.      be used without ----DDDD .... Direct IO will only function on XFS and EFS
  141.      filesystems.
  142.  
  143.      If the ----tttt option is specified then _c_p will attempt to create an output
  144.      file on the realtime extent of the _t_a_r_g_e_t filesystem.  The ----eeee eeeexxxxttttssssiiiizzzzeeee
  145.      option can be used to specify an extent size other than the default for
  146.      the filesystem.  The ----PPPP option is used to indicate that the file size
  147.      should be padded out to a legitimate size for a realtime file if _f_i_l_e_1 is
  148.      not a legitimate size.  The _t_a_r_g_e_t filesystem must be XFS for the ----tttt
  149.      option to work.
  150.  
  151.      With the ----ssss option _l_n creates symbolic links.  A symbolic link is a
  152.      special kind of file whose contents are the name of another file (see
  153.      _s_y_m_l_i_n_k(2)).  A symbolic link contains the name of the file to which it
  154.      is linked.  Most system calls, including _o_p_e_n(2), _s_t_a_t(2), and _a_c_c_e_s_s(2),
  155.      substitute these contents when the name of a symbolic link occurs in a
  156.      pathname.  This process is known as ``following'' symbolic links.
  157.      _s_t_a_t(2), _r_e_a_d_l_i_n_k(2), _s_y_m_l_i_n_k(2), and _u_n_l_i_n_k(2) also do this
  158.      substitution, except on the last component of the pathname.  Thus, they
  159.      are said not to ``follow'' symbolic links.  Symbolic links may span file
  160.      systems and may refer to directories.  Note that _c_p ``follows'' symbolic
  161.      links (except when using the ----RRRR option, while _m_v and _l_n do not ``follow''
  162.      symbolic links.
  163.  
  164.      If the ----iiii option is specified with _c_p, _l_n, or _m_v and _t_a_r_g_e_t exists, the
  165.      user is prompted with the message:
  166.  
  167.           overwrite _t_a_r_g_e_t?
  168.  
  169.      If the user answers with a line starting with `y', the move or copy
  170.      continues.  Any other reply prevents the command from completing.  When
  171.      creating soft links this warning often indicates that the user has
  172.      swapped the _f_i_l_e and _t_a_r_g_e_t parameters, which results in replacement of
  173.      the target file with a dangling symbolic link.
  174.  
  175.      If the _----_iiii option is specified with _m_v, any previous occurrences of the _----_ffff
  176.      option will be ignored.
  177.  
  178.      If the ----rrrr or ----RRRR option is specified with _c_p and any of the source files
  179.      are directories, _c_p copies each subtree rooted at that name; in this case
  180.      target must be a directory.  The difference between ----rrrr and ----RRRR is that ----rrrr
  181.      causes _c_p to follow symbolic links and ----RRRR does not.  (Note that the
  182.      behavior of ----RRRR is defined by POSIX, whereas the behavior of ----rrrr is
  183.      particular to this implementation.)
  184.  
  185.      If the ----RRRR option is specified with _c_p and the source file is not of type
  186.      directory or regular file, then the following steps will be taken:
  187.  
  188.      1111....   The _t_a_r_g_e_t file will be created with the same file type as _f_i_l_e_1.
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCPPPP((((1111))))                                                                    CCCCPPPP((((1111))))
  203.  
  204.  
  205.  
  206.      2222....   If _f_i_l_e_1 is a type FIFO, the _t_a_r_g_e_t file permission bits will be the
  207.           same as those of _f_i_l_e_1 modified by the file creation mask of the
  208.           user if the _----_pppp option was not specified.
  209.  
  210.           If this creation fails for any reason, _c_p will write a diagnostic
  211.           message to standard error, do nothing more with the source file and
  212.           go on to any remaining files.
  213.  
  214. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  215.      chmod(1), cpio(1), rm(1), umask(1).
  216.  
  217. WWWWAAAARRRRNNNNIIIINNNNGGGGSSSS
  218.      _l_n without ----ssss will not link across file systems.  This restriction is
  219.      necessary because file systems can be added and removed.
  220.  
  221. BBBBUUUUGGGGSSSS
  222.      If _f_i_l_e_1 and _t_a_r_g_e_t lie on different file systems, _m_v must copy the file
  223.      and delete the original.  In this case any linking relationship with
  224.      other files is lost.
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.